<%@page import="com.lrf.freeshipping.tool.Common"%>
<%@page import="com.lrf.freeshipping.bean.ProductBean"%>
<%@page import="com.lrf.freeshipping.service.ProductOption"%>
<%@page import="com.lrf.freeshipping.jdbc.JDBCOption"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
  <head>
    <title>修改商品信息</title>    
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" type="image/x-icon" href="assets/image/favicon.ico" />

    <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="css/theme.css">
    <link rel="stylesheet" href="css/font-awesome.css" type="text/css">

    <script src="js/jquery-1.8.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>

    <script type="text/javascript">
      function modifyProduct() {
	    var se=confirm("确定修改该商品信息？");
	    return se;
	}
    </script>
 
    <!-- Demo page code -->
    
    <style type="text/css">
        #line-chart {
            height:300px;
            width:800px;
            margin: 0px auto;
            margin-top: 1em;
        }
        .brand { font-family: georgia, serif; }
        .brand .first {
            color: #ccc;
            font-style: italic;
        }
        .brand .second {
            color: #fff;
            font-weight: bold;
        }
    </style>

     </head>

  <body> 
    
   <jsp:include page="head.jsp"/>
     <!-- 检查是否是登录状态 -->
    <jsp:include page="check-sign-in.jsp"></jsp:include>
    <div class="container-fluid">
        
        <div class="row-fluid">
             <!-- 引入左菜单栏 -->
            <jsp:include page="left-menu.jsp" flush="true"></jsp:include>
        <div class="span9">
            <h1 class="page-title">修改商品</h1>           
<div class="well">
    
    <div id="myTabContent" class="tab-content">
      <div class="tab-pane active in" id="home">
    <form id="tab" action="ModifyProduct" method="post" onsubmit="return modifyProduct()">
        <div class="btn-toolbar" style="float:right">
           <input type="submit" class="btn btn-primary" value="保存"/>
           <input type="reset" class="btn" value="清空"/>
        </div>
        <% String productId = request.getParameter("product_id");
            ProductBean bean = ProductOption.getProduct(productId);
            if(bean==null) {
            	out.write(Common.AlertTo("该商品不存在", "index.jsp"));
                return;	
             } 
            String type = bean.getProductType();
            if(type==null) type = "";
        %>
        <label>商品标签</label>
        <input type="text" class="input-xlarge" style="width: 500px" name="product-title" value="<%=bean.getProductTitle() %>">
        <label>商品推广链接</label>
        <input type="text" class="input-xlarge" style="width: 500px" name="promotion-url" value="<%=bean.getPromotionUrl()%>">
        <label>商品图片链接</label>
        <input type="text" class="input-xlarge" style="width: 500px" name="image-url" value="<%=bean.getImageUrl()%>">
        <label>商品ID</label>
        <input type="text" class="input-xlarge" readOnly="readonly" style="width: 500px" name="product-id" value="<%=bean.getProductId()%>">
        <label>商品类型</label>
         <table class="table">
		    <tr>
                  <td><input type="checkbox" name="product-type" value="Lastest" <%=type.contains("Lastest")?"checked":null%>>&nbsp;&nbsp;Lastest</td>
                  <td><input type="checkbox" name="product-type" value="Women's Fashion" <%=type.contains("Women's Fashion")?"checked":null%>>&nbsp;&nbsp;Women'Fashion</td>
                  <td><input type="checkbox" name="product-type" value="Men's Fashion" <%=type.contains("Men's Fashion")?"checked":null%>>&nbsp;&nbsp;Men'Fashion</td>
				  <td><input type="checkbox" name="product-type" value="Accessories" <%=type.contains("Accessories")?"checked":null%>>&nbsp;&nbsp;Accessories</td>
            </tr>
		    
			<tr>
			     <td><input type="checkbox" name="product-type" value="Jewelry&Watches" <%=type.contains("Jewelry&Watches")?"checked":null%>>&nbsp;&nbsp;Jewelry&Watches</td>
				 <td><input type="checkbox" name="product-type" value="Beauty&Health" <%=type.contains("Beauty&Health")?"checked":null%>>&nbsp;&nbsp;Beauty&Health</td>
				 <td><input type="checkbox" name="product-type" value="Wallet&Bags" <%=type.contains("Wallet&Bags")?"checked":null%>>&nbsp;&nbsp;Wallet&Bags</td>
			     <td><input type="checkbox" name="product-type" value="Gadgets" <%=type.contains("Gadgets")?"checked":null%>>&nbsp;&nbsp;Gadgets</td>
			</tr>		 
		    
			<tr>
			    <td><input type="checkbox" name="product-type" value="Underwear" <%=type.contains("Underwear")?"checked":null%>>&nbsp;&nbsp;Underwear</td>
				<td><input type="checkbox" name="product-type" value="Baby&Kids" <%=type.contains("Baby&Kids")?"checked":null%>>&nbsp;&nbsp;Baby&Kids</td>
				<td><input type="checkbox" name="product-type" value="Home Decor" <%=type.contains("Home Decor")?"checked":null%>>&nbsp;&nbsp;Home Decor</td>
				<td></td>
			</tr>
			<tr><td></td><td></td><td></td><td></td></tr>
		 
		 </table>
		
        <label>商品属性</label>
        <select name="product-attribute" id="product-attribute" class="input-xlarge" >
          <option value ="man" <%="man".equals(bean.getProductAttribute())?"selected":null%>>man</option>  
          <option value ="woman" <%="woman".equals(bean.getProductAttribute())?"selected":null%>>woman</option>  
          <option value="mother" <%="mother".equals(bean.getProductAttribute())?"selected":null%>>mother</option>
          <option value="man&woman" <%="man&woman".equals(bean.getProductAttribute())?"selected":null%>>man&woman</option>
    </select>     
     <label>入库时间</label>
     <input type="text" name="add-time" class="input-xlarge" onclick="WdatePicker({lang:'zh-cn'})" value="<%=bean.getAddTime() %>"/>     
    </form>
 </div>


</div>
</div>
</div>   

    
    <footer>
        <hr>
        
        <p class="pull-right">develop from <a href="#" title="iwenkeji" target="_blank">iwenkeji</a></p>
        
        
        <p>&copy; 2015 <a href="#">跨进电商</a></p>
    </footer>
    

    

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/bootstrap.js"></script>
    
  </body>
</html>


